package com.ruoyi.project.web.videoClassify.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.web.videoClassify.mapper.VideoClassifyMapper;
import com.ruoyi.project.web.videoClassify.domain.VideoClassify;
import com.ruoyi.project.web.videoClassify.service.IVideoClassifyService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 视频分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-21
 */
@Service
public class VideoClassifyServiceImpl implements IVideoClassifyService 
{
    @Autowired
    private VideoClassifyMapper videoClassifyMapper;

    /**
     * 查询视频分类
     * 
     * @param classifyId 视频分类ID
     * @return 视频分类
     */
    @Override
    public VideoClassify selectVideoClassifyById(Long classifyId)
    {
        return videoClassifyMapper.selectVideoClassifyById(classifyId);
    }

    /**
     * 查询视频分类列表
     * 
     * @param videoClassify 视频分类
     * @return 视频分类
     */
    @Override
    public List<VideoClassify> selectVideoClassifyList(VideoClassify videoClassify)
    {
        return videoClassifyMapper.selectVideoClassifyList(videoClassify);
    }

    /**
     * 新增视频分类
     * 
     * @param videoClassify 视频分类
     * @return 结果
     */
    @Override
    public int insertVideoClassify(VideoClassify videoClassify)
    {
        videoClassify.setCreateTime(DateUtils.getNowDate());
        return videoClassifyMapper.insertVideoClassify(videoClassify);
    }

    /**
     * 修改视频分类
     * 
     * @param videoClassify 视频分类
     * @return 结果
     */
    @Override
    public int updateVideoClassify(VideoClassify videoClassify)
    {
        return videoClassifyMapper.updateVideoClassify(videoClassify);
    }

    /**
     * 删除视频分类对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteVideoClassifyByIds(String ids)
    {
        return videoClassifyMapper.deleteVideoClassifyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除视频分类信息
     * 
     * @param classifyId 视频分类ID
     * @return 结果
     */
    @Override
    public int deleteVideoClassifyById(Long classifyId)
    {
        return videoClassifyMapper.deleteVideoClassifyById(classifyId);
    }

    @Override
    public int checkClassifyNameUnique(VideoClassify videoClassify) {
        return videoClassifyMapper.checkClassifyNameUnique(videoClassify);
    }
}
